<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <p class="ptag"></p>
    <input type="text" class="inputtag">

</body>
<script>
    var obj = {}
    var ptag = document.querySelector('.ptag')
    var inputtag = document.querySelector('.inputtag')
    Object.defineProperty(obj,'quanzhan',{
        get:function (val) {
            return val
        },
        set:function (newvalue) {
            inputtag.value = newvalue
            ptag.innerHTML = newvalue
        }
    })
    inputtag.addEventListener('input',function (e) {
        obj.quanzhan = e.target.value
    })
    obj.quanzhan = '2006B'
</script>
</html>
